package com.li.service;

import com.li.mapper.UserMapper;
import com.li.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = RuntimeException.class)
public class UserService {
    @Autowired
    private UserMapper ud;

    public User findUserByUsernameAndPassowrd(User user) {

        return ud.queryUser(user);
    }
    public boolean addUser(User u) {
        return ud.save(u)!=null;
    }
}